﻿/******************************************************************************
* File description: ControlPannelInfo2.qml
* Function: 实验控制信息组件
* Current Version: 1.0.0
* Author: JNN
* Date: 2025-07-01
*  -----
*  Copyright by 博坤生物 .
 *****************************************************************************/
import QtQuick 2.0

Rectangle {

    id: root

    property color color: "#F7F6FF"
    property string title: "语音模块"
    property string content: "正常"

    signal clicked()
    border.color: "#05111111"

    height: 90*dp; width: text_content.contentWidth + 60*dp
    Text{
        id: text_title
        text: title
        font.pixelSize: config.fontsize
        anchors.horizontalCenter: parent.horizontalCenter
        y:16*dp
    }
    Text{
        id: text_content
        text: content
        font.pixelSize: config.fontsize_1
        font.bold: true
        anchors.horizontalCenter: parent.horizontalCenter
        y: 40*dp
        color: {
            if(text === "正常" || text === "开启" || text === "连接"){
                return "green"
            }else if(text === "异常" || text === "关闭" || text === "断开"){
                return "red"
            }else{
                return "#222"
            }
        }
    }
    MouseArea{
        anchors.fill: parent
        onClicked: {
            root.clicked()
        }
    }



}
